package com.ceres.crops.service.impl;

import com.ceres.crops.dao.IndexMapper;
import com.ceres.crops.pojo.Index;
import com.ceres.crops.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IndexServiceImpl implements IndexService {

    @Autowired
    private IndexMapper indexMapper;

    //新增新的数据指标
    @Override
    public void add(Index index) {
        indexMapper.insertSelective(index);
    }

    //更新数据指标
    @Override
    public void update(Index index) {
        indexMapper.updateByPrimaryKey(index);
    }

    //查询所有的数据指标
    @Override
    public List<Index> findAll() {
        return indexMapper.selectAll();
    }
}
